package com.borrow.service.client;

import com.borrow.service.client.impl.UserFallbackClient;
import com.commons.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;


@FeignClient(value = "userservice",fallback = UserFallbackClient.class) //声明为userservice服务的HTTP请求客户端，
// fallback参数指定为我们刚刚编写的实现类
public interface UserClient {
    /**
     *  用于间接 接口内部调用去获取用户信息的接口
     * @param sid
     * @return
     */
    @GetMapping("user/api/{sid}") //记得加入完整路径
    User apiFindUserById(@PathVariable("sid") Integer sid);
}
